#include "random_number_generator.h"
#include <cstdlib>
#include <ctime>

using namespace std;

void RandomNumberGenerator::Generate(int*& array, size_t len)
{
    srand(time(0));
    array = (int*)malloc(sizeof(int) * len);

    for ( size_t i = 0; i < len; ++i )
    {
        array[i] = rand();
    }
}

void RandomNumberGenerator::Free(int*& array)
{
    if ( array != NULL )
    {
        free(array);
        array = NULL;
    }
}
